//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.come.mouslisten;

import java.awt.Color;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import org.come.Jpanel.QuackGameJpanel;
import org.come.until.MessagrFlagUntil;

public class QuackGameMouslisten implements MouseListener {
	private int index;
	private QuackGameJpanel gameJpanel;
	private static ImageIcon icon = new ImageIcon((new ImageIcon("inkImg/hongmu/2/border_quack.png")).getImage().getScaledInstance(48, 48, 10));

	public QuackGameMouslisten(int index, QuackGameJpanel gameJpanel) {
		this.index = index;
		this.gameJpanel = gameJpanel;
	}

	@Override
    public void mouseClicked(MouseEvent e) {
		for(int i = 0; i < 20; ++i) {
			if (BorderFactory.createEmptyBorder() != this.gameJpanel.getLabBorder()[i].getBorder()) {
				this.gameJpanel.getLabBorder()[i].setBorder(BorderFactory.createEmptyBorder());
			}
		}

		this.gameJpanel.getLabBorder()[this.index].setBorder(BorderFactory.createLineBorder(Color.red, 1));
	}

	@Override
    public void mousePressed(MouseEvent e) {
	}

	@Override
    public void mouseReleased(MouseEvent e) {
	}

	@Override
    public void mouseEntered(MouseEvent e) {
		this.gameJpanel.getLabBorder()[this.index].setIcon(icon);
	}

	@Override
    public void mouseExited(MouseEvent e) {
		MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE1);
		this.gameJpanel.getLabBorder()[this.index].setIcon((Icon)null);
	}
}
